package com.lab.spring.topic2;

/**
 * Created with IntelliJ IDEA.
 * User: bsceran
 * Date: 5/22/13
 * Time: 9:27 AM
 * To change this template use File | Settings | File Templates.
 */
public class ProductCreator {

    public static Product createProduct(String productId) {
        if("aaa".equals(productId)) {
            return new Battery("AAA", 3.5);
        } else if("cdrw".equals(productId)) {
            return new Disc("CD-RW", 5.6);
        }
        throw new IllegalArgumentException("Unknown product!");
    }

    public static Product createProduct() {
        return new     Battery("AAA", 3.5);
    }
}
